package com.hsh.server.project.bank.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.hsh.server.common.controller.BaseController;
import com.hsh.server.project.bank.domain.TAppRecentTransactions;
import com.hsh.server.project.bank.service.ITAppRecentTransactionsService;
import com.hsh.server.util.R;
import com.hsh.server.util.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 最近交易Controller
 * 
 * @author ruoyi
 * @date 2025-04-23
 */
@RestController
@RequestMapping("/system/transactions")
public class TAppRecentTransactionsController extends BaseController
{
    @Autowired
    private ITAppRecentTransactionsService tAppRecentTransactionsService;

    /**
     * 查询最近交易列表
     */
    @GetMapping("/list")
    public TableDataInfo list(TAppRecentTransactions tAppRecentTransactions)
    {
        startPage();
        List<TAppRecentTransactions> list = tAppRecentTransactionsService.selectTAppRecentTransactionsList(tAppRecentTransactions);
        return getDataTable(list);
    }
    /**
     * 获取最近交易详细信息
     */
    @GetMapping(value = "/{id}")
    public R getInfo(@PathVariable("id") Long id)
    {
        return R.success(tAppRecentTransactionsService.selectTAppRecentTransactionsById(id));
    }

    /**
     * 新增最近交易
     */
    @PostMapping
    public R add(@RequestBody TAppRecentTransactions tAppRecentTransactions)
    {
        return R.success(tAppRecentTransactionsService.insertTAppRecentTransactions(tAppRecentTransactions));
    }

    /**
     * 修改最近交易
     */
    @PutMapping
    public R edit(@RequestBody TAppRecentTransactions tAppRecentTransactions)
    {
        return R.success(tAppRecentTransactionsService.updateTAppRecentTransactions(tAppRecentTransactions));
    }

    /**
     * 删除最近交易
     */
	@DeleteMapping("/{ids}")
    public R remove(@PathVariable Long[] ids)
    {
        return R.success(tAppRecentTransactionsService.deleteTAppRecentTransactionsByIds(ids));
    }
}
